<p class="pageTitle"><%= l(:common, :editing) + " - " + link_to(@artist.fullname, admin_artist_url(@artist)) + ' - ' + l(:common, :location) %></p>

<%= error_messages_for :artist %>

<% tabnav :artist do %>

<%= GMap.header %>
<%= @map.to_html %>

<p>Drag the map around to select the location of this artist, symbolized by the red marker.  
You can choose to provide information at any level of generality from the continent to the town.
Use the + and - buttons to zoom in and out.
Location information is <strong>optional</strong>.</p>

<p>The map is currently
<% if @artist.show_map %>
  <span style="color:green">SHOWN TO CUSTOMERS</span>
<% else %>
  <span style="color:red">HIDDEN FROM CUSTOMERS</span>
<% end %>
</p>

<p id="saved" class="flashNotice" style="display:none">New map saved successfully.</p>

<%= @map.div(:width => 515, :height => 180) %>

<br />

  <% remote_form_for([:admin, @artist], :html => {:id => 'map_form'}) do |f| %>
    <%= f.hidden_field 'id' %>
    <%= f.hidden_field 'map_lat', :id => 'map_lat' %>
    <%= f.hidden_field 'map_lon', :id => 'map_lon' %>
    <%= f.hidden_field 'map_zoom', :id => 'map_zoom' %>
    <%= f.submit 'Save Changes', :url => {:action => :map_update}%>
  <% end %>
  
  <% if @artist.show_map %>
    <%= button_to "Disable Map", :action => "change_map", :id => @artist.id, :act => "disable" %>
  <% else %>
    <%= button_to "Enable Map", :action => "change_map", :id => @artist.id, :act => "enable" %>
  <% end %>

<% end %>